package com.atguigu1.core.util

import java.io.InputStreamReader
import java.util.Properties

/**
 * @description: 读取文件
 * @time: 2021/3/31 10:51
 * @author: baojinlong
 * */
object PropertiesUtil {
  def loadPropertiesConfigFile(propertiesName: String): Properties = {
    val properties = new Properties
    properties.load(new InputStreamReader(Thread.currentThread.getContextClassLoader.getResourceAsStream(propertiesName), "UTF-8"))
    properties
  }


  def main(args: Array[String]): Unit = {
    val config: Properties = PropertiesUtil.loadPropertiesConfigFile("log4j.properties")
    println(config.getProperty("log4j.logger.org.spark_project.jetty"))
  }

}
